import request from '@/utils/modules/https.js'

// 获取微信openId
export const getWxOpenId = (data) => {
	return request({
		url: '/wx_mini/getWxOpenId',
		data,
		method: 'get'
	})
}

// 获取accessToken
export const getAccessToken = (data) => {
	return request({
		url: '/wx_mini/getAccessToken',
		data,
		method: 'get'
	})
}

// 获取用户信息
export const getUserInfo = (data) => {
	return request({
		url: '/general/getUserInfo',
		data,
		method: 'get'
	})
}

// 用户注册
export const registerUser = (data) => {
	return request({
		url: '/general/registerUser',
		method: 'post',
		data,
		header: {
			'content-type': 'application/json'
		}
	})
}

// 用户信息更新
export const updateUserInfo = (data) => {
	return request({
		url: '/general/updateUserInfo',
		method: 'post',
		data,
		header: {
			'content-type': 'application/json'
		}
	})
}

// 获取用户标识
export const getUserCode = (data) => {
	return request({
		url: '/general/getUserCode',
		method: 'get',
		data
	})
}